package cpu.datastores;
import cpu.components.CacheUnit;
import cpu.components.MemoryUnit;
import cpu.datatypes.Bit;
import cpu.datatypes.Byte;
import cpu.datatypes.Word;


public class CacheLine {
	private CacheUnit cachecontroller;
	public static final int length=16 ;
	private Byte[] cacheline=new Byte[length];
	public boolean dirtybit;
	public Register16 baseline;
	
	
	
	public  CacheLine()
	{
		for(int i=0;i<length;i++)
		{
			cacheline[i]=new Byte();
		}
		
	}
	
	public Byte get(int address)
	{//int offset=address-baseline.toSignedInteger();
		return cacheline[address];
		
	}
	
	
	public void put(int address,Word data )
	{ int offset=address-baseline.toSignedInteger();
	 cacheline[offset].fromByte(data.byteLow);
	// if (offset<16)
	 cacheline[offset+1].fromByte(data.byteHigh);	
	 
	}
	
}
